
import React from 'react';
import classnames from 'classnames';
import css from './index.less';



class MyButton extends React.Component {

  constructor(props) {
    super(props);
    this.state = {};
  }

  buttonChange(e) {
    const { onButtonChange = () => {}, myType, index } = this.props;
    onButtonChange(myType, e.target.value, index);

  }

  componentDidMount() {
  }

  render() {
    const { value, myType } = this.props;
    const props = {
      value: value,
      onChange: this.buttonChange.bind(this),
      className: css.btn,
    };
    props.placeholder = value ? null : `请输入图片的${myType}`;


    return (
      <div className={css.prevBtn}>
        <span className={css.prevSpan}>{myType}:&nbsp;</span>
        <input {...props}/>
      </div>

    );
  }
}
export default MyButton;
